using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
using DIS_BUS_WS.DIS_DAL_WS;
using DIS_BUS_WS.Helpers;
namespace DIS_BUS_WS
{
	public class DIS_BUS_Service: IDIS_BUS_Service
	{
		private IDIS_DAL_Service _svc;
		public DIS_BUS_Service()
		{
			_svc = new ChannelFactory<IDIS_DAL_Service>("BasicHttpBinding_IDIS_DAL_Service").CreateChannel();
		}
		/////////////////// CATEGORY ///////////////////
		public CategoryDTO[] Category_SelectAll()
		{
			return _svc.Category_SelectAll();
		}
		public CategoryDTO Category_SelectByID(int id)
		{
			return _svc.Category_SelectByID(id);
		}
		public bool Category_Insert(CategoryDTO obj)
		{
			return _svc.Category_Insert(obj);
		}
		public bool Category_Delete(int id)
		{
			return _svc.Category_Delete(id);
		}
		public bool Category_Update(CategoryDTO obj)
		{
			return _svc.Category_Update(obj);
		}
		public CategoryDTO[] Category_RetrieveByID(int id)
		{
			return _svc.Category_RetrieveByID(id);
		}
		/////////////////// DAILYREPORT ///////////////////
		public DailyReportDTO[] DailyReport_SelectAll()
		{
			return _svc.DailyReport_SelectAll();
		}
		public DailyReportDTO DailyReport_SelectByID(int id)
		{
			return _svc.DailyReport_SelectByID(id);
		}
		public bool DailyReport_Insert(DailyReportDTO obj)
		{
			return _svc.DailyReport_Insert(obj);
		}
		public bool DailyReport_Delete(int id)
		{
			return _svc.DailyReport_Delete(id);
		}
		public bool DailyReport_Update(DailyReportDTO obj)
		{
			return _svc.DailyReport_Update(obj);
		}
		public DailyReportDTO[] DailyReport_RetrieveByID(int id)
		{
			return _svc.DailyReport_RetrieveByID(id);
		}
		public DailyReportDTO[] DailyReport_SelectByIDRestaurant(int idrestaurant)
		{
			return _svc.DailyReport_SelectByIDRestaurant(idrestaurant);
		}
        public DailyReportDTO DailyReport_SelectByIDRestaurantAndReportDate(int idrestaurant, DateTime reportdate)
        {
            return _svc.DailyReport_SelectByIDRestaurantAndReportDate(idrestaurant, reportdate);
        }
		/////////////////// WEEKLYREPORT ///////////////////
		public WeeklyReportDTO[] WeeklyReport_SelectAll()
		{
			return _svc.WeeklyReport_SelectAll();
		}
		public WeeklyReportDTO WeeklyReport_SelectByID(int id)
		{
			return _svc.WeeklyReport_SelectByID(id);
		}
		public bool WeeklyReport_Insert(WeeklyReportDTO obj)
		{
			return _svc.WeeklyReport_Insert(obj);
		}
		public bool WeeklyReport_Delete(int id)
		{
			return _svc.WeeklyReport_Delete(id);
		}
		public bool WeeklyReport_Update(WeeklyReportDTO obj)
		{
			return _svc.WeeklyReport_Update(obj);
		}
		public WeeklyReportDTO[] WeeklyReport_RetrieveByID(int id)
		{
			return _svc.WeeklyReport_RetrieveByID(id);
		}
		public WeeklyReportDTO[] WeeklyReport_SelectByIDRestaurant(int idrestaurant)
		{
			return _svc.WeeklyReport_SelectByIDRestaurant(idrestaurant);
		}
        public WeeklyReportDTO WeeklyReport_SelectByIDRestaurantAndReportDate(int idrestaurant, DateTime startdate, DateTime enddate)
        {
            return _svc.WeeklyReport_SelectByIDRestaurantAndReportDate(idrestaurant, startdate, enddate);
        }
		/////////////////// ITEM ///////////////////
		public ItemDTO[] Item_SelectAll()
		{
			return _svc.Item_SelectAll();
		}
		public ItemDTO Item_SelectByID(int id)
		{
			return _svc.Item_SelectByID(id);
		}
		public bool Item_Insert(ItemDTO obj)
		{
			return _svc.Item_Insert(obj);
		}
		public bool Item_Delete(int id)
		{
			return _svc.Item_Delete(id);
		}
		public bool Item_Update(ItemDTO obj)
		{
			return _svc.Item_Update(obj);
		}
		public ItemDTO[] Item_RetrieveByID(int id)
		{
			return _svc.Item_RetrieveByID(id);
		}
		public ItemDTO[] Item_SelectByIDCategory(int idcategory)
		{
			return _svc.Item_SelectByIDCategory(idcategory);
		}
		/////////////////// EMPLOYEE ///////////////////
		public EmployeeDTO[] Employee_SelectAll()
		{
			return _svc.Employee_SelectAll();
		}
		public EmployeeDTO Employee_SelectByID(int id)
		{
			return _svc.Employee_SelectByID(id);
		}
		public bool Employee_Insert(EmployeeDTO obj)
		{
			return _svc.Employee_Insert(obj);
		}
		public bool Employee_Delete(int id)
		{
			return _svc.Employee_Delete(id);
		}
		public bool Employee_Update(EmployeeDTO obj)
		{
			return _svc.Employee_Update(obj);
		}
		public EmployeeDTO[] Employee_RetrieveByID(int id)
		{
			return _svc.Employee_RetrieveByID(id);
		}
		public EmployeeDTO[] Employee_SelectByIDRole(int idrole)
		{
			return _svc.Employee_SelectByIDRole(idrole);
		}
		public EmployeeDTO[] Employee_SelectByIDRestaurant(int idrestaurant)
		{
			return _svc.Employee_SelectByIDRestaurant(idrestaurant);
		}
        public EmployeeDTO Employee_SelectByUserName(string username)
        {
            return _svc.Employee_SelectByUserName(username);
        }
        public EmployeeDTO Employee_SelectByUserNameAndPassword(string username, string password)
        {
            return _svc.Employee_SelectByUserNameAndPassword(username, password);
        }
		/////////////////// NATIONALPROMOTION ///////////////////
		public NationalPromotionDTO[] NationalPromotion_SelectAll()
		{
			return _svc.NationalPromotion_SelectAll();
		}
		public NationalPromotionDTO NationalPromotion_SelectByID(int id)
		{
			return _svc.NationalPromotion_SelectByID(id);
		}
		public bool NationalPromotion_Insert(NationalPromotionDTO obj)
		{
			return _svc.NationalPromotion_Insert(obj);
		}
		public bool NationalPromotion_Delete(int id)
		{
			return _svc.NationalPromotion_Delete(id);
		}
		public bool NationalPromotion_Update(NationalPromotionDTO obj)
		{
			return _svc.NationalPromotion_Update(obj);
		}
		public NationalPromotionDTO[] NationalPromotion_RetrieveByID(int id)
		{
			return _svc.NationalPromotion_RetrieveByID(id);
		}
		public NationalPromotionDTO NationalPromotion_SelectByIDItem(int iditem)
		{
			return _svc.NationalPromotion_SelectByIDItem(iditem);
		}
		/////////////////// LOCALPROMOTION ///////////////////
		public LocalPromotionDTO[] LocalPromotion_SelectAll()
		{
			return _svc.LocalPromotion_SelectAll();
		}
		public LocalPromotionDTO LocalPromotion_SelectByID(int id)
		{
			return _svc.LocalPromotion_SelectByID(id);
		}
		public bool LocalPromotion_Insert(LocalPromotionDTO obj)
		{
			return _svc.LocalPromotion_Insert(obj);
		}
		public bool LocalPromotion_Delete(int id)
		{
			return _svc.LocalPromotion_Delete(id);
		}
        public bool LocalPromotion_DeleteByIDItemAndIDRestaurant(int iditem, int idrestaurant)
        {
            return _svc.LocalPromotion_DeleteByIDItemAndIDRestaurant(iditem, idrestaurant);
        }
		public bool LocalPromotion_Update(LocalPromotionDTO obj)
		{
			return _svc.LocalPromotion_Update(obj);
		}
		public LocalPromotionDTO[] LocalPromotion_RetrieveByID(int id)
		{
			return _svc.LocalPromotion_RetrieveByID(id);
		}
		public LocalPromotionDTO[] LocalPromotion_SelectByIDItem(int iditem)
		{
			return _svc.LocalPromotion_SelectByIDItem(iditem);
		}
		public LocalPromotionDTO[] LocalPromotion_SelectByIDRestaurant(int idrestaurant)
		{
			return _svc.LocalPromotion_SelectByIDRestaurant(idrestaurant);
		}
        public LocalPromotionDTO LocalPromotion_SelectByIDItemAndIDRestaurant(int iditem, int idrestaurant)
        {
            return _svc.LocalPromotion_SelectByIDItemAndIDRestaurant(iditem, idrestaurant);
        }
		/////////////////// ORDERS ///////////////////
		public OrdersDTO[] Orders_SelectAll()
		{
			return _svc.Orders_SelectAll();
		}
		public OrdersDTO Orders_SelectByID(int id)
		{
			return _svc.Orders_SelectByID(id);
		}
		public bool Orders_Insert(ref OrdersDTO obj)
		{
			return _svc.Orders_Insert(ref obj);
		}
		public bool Orders_Delete(int id)
		{
			return _svc.Orders_Delete(id);
		}
		public bool Orders_Update(OrdersDTO obj)
		{
			return _svc.Orders_Update(obj);
		}
		public OrdersDTO[] Orders_RetrieveByID(int id)
		{
			return _svc.Orders_RetrieveByID(id);
		}
		public OrdersDTO[] Orders_SelectByIDRestaurant(int idrestaurant)
		{
            try
            {
                return _svc.Orders_SelectByIDRestaurant(idrestaurant);
            }
            catch (Exception ex)
            {
                if (ex.InnerException != null)
                {
                    GlobalVariables.Logger.Error(ex.InnerException.Message);
                }
                else
                {
                    GlobalVariables.Logger.Error(ex.Message);
                }
            }
            return null;
		}
        public OrdersDTO[] Orders_SelectByIDRestaurantAndOrderDate(int idrestaurant, DateTime orderdate)
        {
            return _svc.Orders_SelectByIDRestaurantAndOrderDate(idrestaurant, orderdate);
        }
		/////////////////// ORDERDETAIL ///////////////////
		public OrderDetailDTO[] OrderDetail_SelectAll()
		{
			return _svc.OrderDetail_SelectAll();
		}
		public OrderDetailDTO OrderDetail_SelectByID(int id)
		{
			return _svc.OrderDetail_SelectByID(id);
		}
		public bool OrderDetail_Insert(OrderDetailDTO obj)
		{
			return _svc.OrderDetail_Insert(obj);
		}
		public bool OrderDetail_Delete(int id)
		{
			return _svc.OrderDetail_Delete(id);
		}
        public bool OrderDetail_DeleteByOrder(int idorder)
        {
            return _svc.OrderDetail_DeleteByOrder(idorder);
        }
		public bool OrderDetail_Update(OrderDetailDTO obj)
		{
			return _svc.OrderDetail_Update(obj);
		}
		public OrderDetailDTO[] OrderDetail_RetrieveByID(int id)
		{
			return _svc.OrderDetail_RetrieveByID(id);
		}
		public OrderDetailDTO[] OrderDetail_SelectByIDOrder(int idorder)
		{
			return _svc.OrderDetail_SelectByIDOrder(idorder);
		}
		public OrderDetailDTO[] OrderDetail_SelectByIDItem(int iditem)
		{
			return _svc.OrderDetail_SelectByIDItem(iditem);
		}
		/////////////////// ROLEFUNCTIONS ///////////////////
		public RoleFunctionsDTO[] RoleFunctions_SelectAll()
		{
			return _svc.RoleFunctions_SelectAll();
		}
		public RoleFunctionsDTO RoleFunctions_SelectByID(int id)
		{
			return _svc.RoleFunctions_SelectByID(id);
		}
		public bool RoleFunctions_Insert(RoleFunctionsDTO obj)
		{
			return _svc.RoleFunctions_Insert(obj);
		}
		public bool RoleFunctions_Delete(int id)
		{
			return _svc.RoleFunctions_Delete(id);
		}
		public bool RoleFunctions_Update(RoleFunctionsDTO obj)
		{
			return _svc.RoleFunctions_Update(obj);
		}
		public RoleFunctionsDTO[] RoleFunctions_RetrieveByID(int id)
		{
			return _svc.RoleFunctions_RetrieveByID(id);
		}
		public RoleFunctionsDTO[] RoleFunctions_SelectByIDRole(int idrole)
		{
			return _svc.RoleFunctions_SelectByIDRole(idrole);
		}
		public RoleFunctionsDTO[] RoleFunctions_SelectByIDFunction(int idfunction)
		{
			return _svc.RoleFunctions_SelectByIDFunction(idfunction);
		}
		/////////////////// FUNCTIONS ///////////////////
		public FunctionsDTO[] Functions_SelectAll()
		{
			return _svc.Functions_SelectAll();
		}
		public FunctionsDTO Functions_SelectByID(int id)
		{
			return _svc.Functions_SelectByID(id);
		}
		public bool Functions_Insert(FunctionsDTO obj)
		{
			return _svc.Functions_Insert(obj);
		}
		public bool Functions_Delete(int id)
		{
			return _svc.Functions_Delete(id);
		}
		public bool Functions_Update(FunctionsDTO obj)
		{
			return _svc.Functions_Update(obj);
		}
		public FunctionsDTO[] Functions_RetrieveByID(int id)
		{
			return _svc.Functions_RetrieveByID(id);
		}
		/////////////////// ROLE ///////////////////
		public RoleDTO[] Role_SelectAll()
		{
			return _svc.Role_SelectAll();
		}
		public RoleDTO Role_SelectByID(int id)
		{
			return _svc.Role_SelectByID(id);
		}
		public bool Role_Insert(RoleDTO obj)
		{
			return _svc.Role_Insert(obj);
		}
		public bool Role_Delete(int id)
		{
			return _svc.Role_Delete(id);
		}
		public bool Role_Update(RoleDTO obj)
		{
			return _svc.Role_Update(obj);
		}
		public RoleDTO[] Role_RetrieveByID(int id)
		{
			return _svc.Role_RetrieveByID(id);
		}
		/////////////////// RESTAURANT ///////////////////
		public RestaurantDTO[] Restaurant_SelectAll()
		{
			return _svc.Restaurant_SelectAll();
		}
		public RestaurantDTO Restaurant_SelectByID(int id)
		{
			return _svc.Restaurant_SelectByID(id);
		}
		public bool Restaurant_Insert(RestaurantDTO obj)
		{
			return _svc.Restaurant_Insert(obj);
		}
		public bool Restaurant_Delete(int id)
		{
			return _svc.Restaurant_Delete(id);
		}
		public bool Restaurant_Update(RestaurantDTO obj)
		{
			return _svc.Restaurant_Update(obj);
		}
		public RestaurantDTO[] Restaurant_RetrieveByID(int id)
		{
			return _svc.Restaurant_RetrieveByID(id);
		}
	}
}
